package com.atguigu;

public class BillingCalculator {
    public static double calculateCost(int seconds) {
        if (seconds < 0) {
            throw new IllegalArgumentException("通话时间不能为负数");
        }
        int minutes = (int) Math.ceil(seconds / 60.0);
        if (minutes == 0) {
            minutes = 1; // 处理0秒的情况，计为1分钟
        }
        if (minutes <= 20) {
            return minutes * 0.05;
        } else {
            return 1.00 + (minutes - 20) * 0.10;
        }
    }
}
